@use "../variables" as *;
@use "sass:color";
@use "../global/fonts" as *;

.crop-search-result-wrapper {
  .crop-search-results-wrapper {
    display: grid;
    gap: 1.5rem 1rem;
    grid-template-columns: repeat(2, 1fr);
  }
  .plant-catalog-tile {
    position: relative;
    cursor: pointer;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0px 4px 7px 2px $translucent;
    background: var(--secondary-bg);
    transition: transform 0.2s ease;
    padding: 0;
    &:hover {
      box-shadow: 0px 5px 8px 2px rgba(0, 0, 0, 0.25);
      transform: translateY(-1px);
    }
    label {
      position: absolute;
      cursor: pointer;
      left: 0;
      bottom: 0;
      right: 0;
      padding: 3rem 0.6rem 0.2rem;
      background: linear-gradient(transparent, $translucent15 50%, $translucent4);
      border-bottom-left-radius: 5px;
      border-bottom-right-radius: 5px;
      color: $white;
      font-size: 1.2rem !important;
    }
    img {
      position: absolute;
      top: 1rem;
      left: 1rem;
      height: 4rem;
      width: 4rem;
      filter: drop-shadow(0 0 15px $translucent5) drop-shadow(0 0 10px $translucent5) drop-shadow(0 0 3px $translucent5);
      &.center {
        top: calc(50% - 3rem);
        left: calc(50% - 3rem);
        width: 6rem;
        height: 6rem;
      }
    }
  }
}

.crop-info-panel {
  .panel-header {
    position: inherit;
    background-size: 144% !important;
    background-repeat: no-repeat !important;
    background-position: top center !important;
    min-height: 125px;
    color: $off_white;
    .panel-title {
      overflow: visible;
      .title {
        font-family: $inknut;
        font-weight: bold;
      }
      .bp6-popover-wrapper {
        position: absolute;
        right: 0;
      }
      .plus-grid-btn {
        position: absolute;
        bottom: -8.5rem;
        right: 1.5rem;
        box-shadow: inset 0 0 0 1.5px $off_white !important;
        color: $off_white !important;
      }
    }
  }
  .panel-content {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    .non-empty-state {
      gap: 1rem;
    }
    .crop-companions {
      display: flex;
      gap: 0.75rem 1rem;
      flex-wrap: wrap;
    }
    .companion {
      display: inline-block;
      text-decoration: none !important;
      background: var(--secondary-bg);
      border-radius: 2rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      padding: .25rem .75rem .25rem .5rem;
      p {
        font-weight: bold;
        text-transform: none;
        white-space: nowrap;
      }
    }
    img {
      width: 100%;
      border-radius: 0.5rem;
    }
  }
  .crop-info-grid {
    grid-template-columns: auto auto;
  }
  .crop-info-field-data {
    font-size: 1.3rem;
    margin-left: 2.5rem;
  }
}

.info-box {
  background: var(--secondary-bg);
  box-shadow: var(--box-shadow);
  border-radius: 0.5rem;
  padding: 1rem;
  align-content: baseline;
  &:has(.crop-companions) {
    grid-column: span 2;
  }
}
